﻿using MetroFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ComUIControl
{
    /// <summary>
    /// 用于处理各类错误过程信息
    /// </summary>
    public class ComBox
    {
        public static void ShowErrorMessage(IWin32Window owner, string message, string title)
        {
            MetroMessageBox.Show(
                    owner,
                   message,
                   title,
                   MessageBoxButtons.OK,
                   MessageBoxIcon.Error,
                   560);
        }

        public static void ShowAutoErrorMessage(IWin32Window owner, string message, string title, int cd = 10)
        {
            AutoMetroMessageBox.Show(
                    owner,
                   message,
                   title,
                   MessageBoxButtons.OK,
                   MessageBoxIcon.Error,
                   600, cd);
        }

        public static void ShowWarnMessage(IWin32Window owner, string message, string title)
        {
            MetroMessageBox.Show(
                   owner,
                   message,
                   title,
                   MessageBoxButtons.OK,
                   MessageBoxIcon.Warning,
                   460);
        }

        public static void ShowAutoWarnMessage(IWin32Window owner, string message, string title)
        {
            AutoMetroMessageBox.Show(
                   owner,
                   message,
                   title,
                   MessageBoxButtons.OK,
                   MessageBoxIcon.Warning,
                   460, 10);
        }

        public static DialogResult ShowYesNoBox(IWin32Window owner, string message, string title)
        {
            return MetroMessageBox.Show(
                   owner,
                   message,
                   title,
                   MessageBoxButtons.YesNo,
                   MessageBoxIcon.Question);
        }
    }
}
